import request from '@/utils/request'


export function getList(query) {
  return request({
    url: '/api/distributors/list',
    method: 'get',
    params: query
  })
}
export function updateDevice() {
  return request({
    url: '/api/distributors/update_device',
    method: 'get'
  })
}

export function all(type = '') {
  return request({
    url: '/api/distributors/all',
    method: 'get',
    params:{
      type:type
    }
  })
}

export function getDevice(distributor_id){
  return request({
    url: '/api/device/distributor_device',
    method: 'get',
    params:{
      distributor_id:distributor_id
    }
  })
}


export function create(data) {
  return request({
    url: '/api/distributors/create',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: '/api/distributors/delete',
    method: 'get',
    params: { id }
  })
}

export function changeStatus(val, id) {
  return request({
    url: '/api/distributors/change_status',
    method: 'get',
    params: {
      id: id,
      status: val
    }
  })
}


export function getBankInfo(id) {
  return request({
    url: '/api/distributors/get_banks',
    method: 'get',
    params: {
      distributor_id: id,
    }
  })
}
